package lab02.test30;

import java.util.Scanner;

public class Test30 {
    public static void main(String[] args) {
       //从键盘读取一个考试分数列表，计算它们的平均分
        double[] score=new double[4];
        String[] course={"数据库","英语","数学","语文"};
        double sum=0;


        Scanner sc=new Scanner(System.in);
        for (int i=0;i<score.length;i++){
            System.out.println("请输入"+course[i]+"成绩：");
            score[i]=sc.nextDouble();
            sum+=score[i];
        }
        System.out.println("成绩平均分为："+sum/score.length);
    }
}
